package com.asj.house.controller;

import com.asj.house.client.HouseSubscribeClient;
import com.asj.house.returns.RespTable;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 预约模块 前端控制器
 * </p>
 *
 * @author asj
 * @since 2021-02-06
 */
@RestController
@RequestMapping("/house-subscribe")
@Slf4j
@Api(value = "预约管理相关接口", tags = "预约管理相关接口")
public class HouseSubscribeController {

    @Autowired
    private HouseSubscribeClient houseSubscribeClient;

    @GetMapping("/list")
    @ApiOperation("预约列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "page", value = "当前页数", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "limit", value = "每页数量", required = true)
    })
    public RespTable listSubscribe(@RequestParam(value = "page", required = true) Integer page,
                                   @RequestParam(value = "limit", required = true) Integer limit) {
        RespTable respTable = houseSubscribeClient.queryAllSubscribe(page, limit);
        return respTable;
    }

}
